//
//  PTStuLifeServiceTopButton.m
//  PlanTech
//
//  Created by ruifeng song on 2018/7/10.
//  Copyright © 2018年  androidlongs. All rights reserved.
//

#import "PTStuLifeServiceTopButton.h"

@implementation PTStuLifeServiceTopButton

-(instancetype)initButtonWithImage:(nullable UIImage *)btnImage btnTitle:(nullable NSString *)btnTitle
{
    if (self = [super init]) {
        
        self.backgroundColor = [UIColor clearColor];
        
        if (btnTitle !=nil && btnTitle.length>0) {
            
            _btnLabel = [[UILabel alloc]init];
            _btnLabel.textColor = [UIColor whiteColor];
            _btnLabel.text = btnTitle;
            _btnLabel.textAlignment = NSTextAlignmentCenter;
        
            [self addSubview:_btnLabel];
        }
        
        if (btnImage !=nil) {
            
            _btnImageView = [[UIImageView alloc]init];
            [_btnImageView setImage:btnImage];
            [self addSubview:_btnImageView];
        }
    }
    return self;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
